﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WMS.BLL
{
    public class ErrorInfo
    {
        private static WMS.IDAL.IErrorInfo dal = WMS.DAL.Factory.DataAccess.CreateErrorInfoObject();
        private static readonly object lockObj = new object();

        static ErrorInfo()
        {
            if (Instance == null)
            {
                lock (lockObj)
                {
                    if (Instance == null)
                    {
                        Instance = new ErrorInfo();
                    }
                }
            }
        }

        public static ErrorInfo Instance
        {
            get;
            private set;
        }

        public void Add(string Title, string Message)
        {
            WMS.Entity.ErrorInfoEntity entity = new WMS.Entity.ErrorInfoEntity();
            entity.Title = Title;
            entity.Message = Message;

            dal.Add(entity);
        }
    }
}
